package main.java.chessfootball.model.regulation;

import main.java.chessfootball.model.game.Area;
import main.java.chessfootball.model.game.Cell;
import main.java.chessfootball.model.game.Field;

/**
 * User: Igor
 * Date: 10.06.2011
 * Time: 21:54:23
 */
public enum Period
{
	FT(1, Field.CENTRE_SPOT, new Area[][]{Field.INVERT_HALF_WAY_AREA}, new Area[][]{Field.INVERT_HALF_WAY_AREA, Field.HALF_CENTRE_CIRCLE_AREA}),
	ST(2, Field.CENTRE_SPOT, new Area[][]{Field.INVERT_HALF_WAY_AREA}, new Area[][]{Field.INVERT_HALF_WAY_AREA, Field.HALF_CENTRE_CIRCLE_AREA}),
	OT(3, Field.CENTRE_SPOT, new Area[][]{Field.INVERT_HALF_WAY_AREA}, new Area[][]{Field.INVERT_HALF_WAY_AREA, Field.HALF_CENTRE_CIRCLE_AREA});
//	PS,
//	FK,
//	CK

	private int id;
	private Cell[] startBallPosition;
	private Area[][] deniedAreasForStartSide;
	private Area[][] deniedAreasForSecondSide;

	Period(int id, Cell[] startBallPosition, Area[][] deniedAreasForStartSide, Area[][] deniedAreasForSecondSide)
	{
		this.id = id;
		this.startBallPosition = startBallPosition;
		this.deniedAreasForStartSide = deniedAreasForStartSide;
		this.deniedAreasForSecondSide = deniedAreasForSecondSide;
	}

	public int getId()
	{
		return id;
	}

	public Cell[] getStartBallPosition()
	{
		return startBallPosition;
	}

	public Area[][] getDeniedArea(boolean startSide)
	{
		return startSide ? deniedAreasForStartSide : deniedAreasForSecondSide;
	}
}
